Skip to content

Conversation

gururaj1512
Copy link
Member

Resolves None

Description

What is the purpose of this pull request?

This pull request:

  • feat: add ndarray/base/binary-input-casting-dtype

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves None

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@gururaj1512 gururaj1512 added GSoC Google Summer of Code. gsoc: 2025 Google Summer of Code (2025). labels Aug 17, 2025
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 17, 2025
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
ndarray/base/binary-input-casting-dtype $\color{red}141/148$
$\color{green}+95.27\%$
$\color{red}26/29$
$\color{green}+89.66\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{red}141/148$
$\color{green}+95.27\%$

The above coverage report was generated for the changes in this PR.

@gururaj1512
Copy link
Member Author

Currently the examples are failing. But it can be tackled through

function safeInputCastingDataType( dtype1, dtype2, dtype3, policy ) {
	try {
		return inputCastingDataType( dtype1, dtype2, dtype3, policy );
	} catch ( error ) {
		if ( policy === 'none' && ( dtype1 !== dtype2 || dtype2 !== dtype3 ) ) {
			return 'incompatible';
		}
		return error;
	}
}

// Resolve casting data types:
logEachMap( 'dtypes: (%10s, %10s, %10s). policy: %20s. result: %10s.', args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], naryFunction( safeInputCastingDataType, 4 ) );

Is above method correct? Or do we have similar packages/method to perform it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GSoC Google Summer of Code. gsoc: 2025 Google Summer of Code (2025). Needs Review A pull request which needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants